// 查询订单详情
const cloud = require('wx-server-sdk');
cloud.init({
  env: cloud.DYNAMIC_CURRENT_ENV
});
const db = cloud.database();
exports.main = async (event, context) => {
  if(!event.openId){
    return {
      code:500,
      msg:"缺少openId"
    }
  }
  const res = await db.collection('userOrders').doc(event.id).get();
  return {...res,code:200};
}